import React, { Component } from 'react'


export default class Header extends Component {
	constructor(){
		console.log('constructor')
		super()
		// this.state = {
		// 	num:0
		// }
	}
	state = {
		num:0
	}
	add=()=>{
		this.state.num ++
		// console.log(this.state.num)
		this.setState({
			num:this.state.num
			
		})
	}
	
	render() {
		console.log('render')
		console.log(this.state.num)
		return (
			<>
				<div>
					我的头部
				</div>
				<div>
					{this.state.num}
					<button onClick={this.add}>+</button>
				</div>
			</>
		);
	}
}